import 'package:flutter/material.dart';
import 'package:modal_bottom_sheet/modal_bottom_sheet.dart';

class CommonBottomSheet {
  /// 仅封装 bottom sheet 展示逻辑，UI 全部由外部 child 提供。
  static Future<T?> show<T>(BuildContext context, {required Widget child}) {
    return showMaterialModalBottomSheet<T>(
      context: context,
      backgroundColor: Colors.transparent, // 交给 child 自己控制背景
      barrierColor: Colors.black54,
      builder: (context) {
        return SafeArea(
          top: false,
          bottom: false,
          child: Padding(padding: const EdgeInsets.only(top: 8), child: child),
        );
      },
    );
  }
}
